<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>案例1</title>
    <style>
        .mydiv {
            width: 100px;
            height: 100px;
            background-color: black;
            margin-top: 30px;
        }
    </style>
</head>
<!-- 179001202 张皓然 -->

<body>
    <div style="width: 300px;margin: 100px auto;">
        <div>
            <button onclick="d.style.width = '200px'">变宽</button>
            <button onclick="d.style.height = '200px'">变高</button>
            <button onclick="d.style.backgroundColor = 'red'">变色</button>
            <button onclick="d.style.display = 'none'">隐藏</button>
            <button onclick="d.style = mystyle">重置</button>
        </div>
        <div class="mydiv">
        </div>
    </div>

    <script>
        let d = document.querySelector('.mydiv')
        let mystyle = d.style
    </script>

</body>

</html>